Don't. Though this may be possible if you wish to cross into Somaliland, borders are generally sealed, and always dangerous.
By ship
By ship
There are ports in Boosaaso, Berbera, Kismaayo, and Mogadishu. The waters outside of Somalia, especially the Gulf of Aden, are unsafe due to pirates; thus, caution is advised.